package com.hingsmy.pma.dao;

import com.hingsmy.pma.dto.ChartData;
import com.hingsmy.pma.entities.Project;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

public interface ProjectRepository extends CrudRepository<Project,Long> {
    public List<Project> findAll();
    @Query(nativeQuery = true,value = "SELECT  stage as label,COUNT (*) as value FROM project GROUP  BY stage")
    List<ChartData>getProjectStatus();
}
